package yichang;

//201521123058
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.net.Socket;
import java.util.Scanner;

import org.omg.CORBA.portable.OutputStream;

public class Main0 {
public static void main(String[] args) {
	//201521123058
	try{
     Socket s = new Socket("127.0.0.1", 12344);
     try{
        InputStream inStream = s.getInputStream();
        java.io.OutputStream outStream = s.getOutputStream();
        Scanner in = new Scanner(inStream);
        PrintWriter out=new PrintWriter(outStream,true);
        Scanner on=new Scanner(System.in);
        out.println("hello");
        while (in.hasNextLine())
        {  
           in=new Scanner(inStream);
           String line = in.nextLine();
           System.out.println(line);
           String line0 = on.nextLine();
           out.println(line0);
        }
     }
     finally
     {
        s.close();
     }
  }
  catch (IOException e)
  {
     e.printStackTrace();
  }
}
}